# -*- coding: utf-8 -*-
from pipe.readExcel import readExcel, exportExcel


def SelectHeight(path,selectField1,selectField2,value,excelName):
    '''高程筛选'''
    df=readExcel(path)
    # df['res'] = df.duplicated(duplicateFields, keep='last')
    # todo：选择的df，默认不改变原来的df
    df2=df[(df[selectField1]>value)| (df[selectField2]>value) ]
    # df[df[selectField1]>=value]

    exportExcel(path,df2,excelName)


def SelectHeightIsIn(path,selectField1,slectvalues,excelName):
    '''高程筛选'''
    df=readExcel(path)
    # df['res'] = df.duplicated(duplicateFields, keep='last')
    # todo：选择的df，默认不改变原来的df
    df2=df.loc[df[selectField1].isin(slectvalues)]
    # df[df[selectField1]>=value]

    exportExcel(path,df2,excelName)

if __name__ == '__main__':
    selectField1='S_H'
    selectField2='E_H'
    value=700
    excelName="高程检查"
    path=r"E:\data\qingyang\qingyangmdb\result\6.2023.02.19处理\管线数据处理\7-后半部分【结果】不重复-管线调查表.xlsx"
    SelectHeight(path,selectField1,selectField2,value,excelName)

